package com.ysh.mapper;

import com.ysh.domain.Student;
import com.ysh.sql.ReturnSql;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface StudentMapper {
    // 查询全部
    // @Select("select * from t_student")
    @SelectProvider(type = ReturnSql.class, method = "getSelectAll")
    public abstract List<Student> selectAll();

    // 新增操作
    // @Insert("insert into t_student values(#{id},#{name},#{age})")
    @InsertProvider(type = ReturnSql.class, method = "getInsert")
    public abstract Integer insert(Student stu);

    // 修改操作
    // @Update("update t_student set name=#{name},age=#{age} where id=#{id}")
    @UpdateProvider(type = ReturnSql.class, method = "getUpdate")
    public abstract Integer update(Student stu);


    // 删除操作
    // @Delete("delete from t_student where id=#{id}")
    @DeleteProvider(type = ReturnSql.class, method = "getDelete")
    public abstract Integer delete(Integer id);
}
